/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.util.HashMap;
/*     */ import java.util.HashSet;
/*     */ import java.util.List;
/*     */ import java.util.Locale;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import java.util.UUID;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import java.util.concurrent.ExecutorService;
/*     */ import java.util.concurrent.Executors;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.model.ModelBase;
/*     */ import net.minecraft.client.resources.IResource;
/*     */ import net.minecraft.entity.Entity;
/*     */ import net.minecraft.entity.EntityList;
/*     */ import net.minecraft.entity.EntityLivingBase;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import org.yaml.snakeyamla.configuration.ConfigurationSection;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class xea
/*     */   extends jca
/*     */ {
/*  35 */   public static xea m = new xea();
/*  36 */   public static eb l = new eb(null);
/*     */   
/*     */   public ConcurrentHashMap<UUID, String> t() {
/*  39 */     return this.t;
/*     */   }
/*     */   
/*  42 */   private final ConcurrentHashMap<UUID, String> t = new ConcurrentHashMap<>();
/*     */   
/*  44 */   private final ConcurrentHashMap<String, eos/moe/dragoncore/ija> d = new ConcurrentHashMap<>();
/*     */   
/*  46 */   private final ConcurrentHashMap<String, eos/moe/dragoncore/tga> z = new ConcurrentHashMap<>();
/*     */   
/*  48 */   private final ConcurrentHashMap<String, eos/moe/dragoncore/tga> i = new ConcurrentHashMap<>();
/*     */   
/*  50 */   private final ConcurrentHashMap<String, eos/moe/dragoncore/tga> w = new ConcurrentHashMap<>();
/*     */   
/*  52 */   private final eos/moe/dragoncore/tga q = new eos/moe/dragoncore/tga(th.v(), null);
/*  53 */   private final ExecutorService g = Executors.newCachedThreadPool();
/*     */ 
/*     */   
/*     */   public void v() {
/*  57 */     super.v();
/*     */     
/*  59 */     this.z.clear();
/*  60 */     this.i.clear();
/*  61 */     this.w.clear();
/*     */   }
/*     */   
/*     */   public void z() {
/*  65 */     this.g.shutdownNow();
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public eos/moe/dragoncore/ija v(EntityLivingBase entityLivingBase) {
/*  71 */     eos/moe/dragoncore/ija eos/moe/dragoncore/ija = z(entityLivingBase);
/*  72 */     if (eos/moe/dragoncore/ija != null && 
/*  73 */       eos/moe/dragoncore/ija.z()) {
/*  74 */       String str = v(entityLivingBase);
/*  75 */       if (!str.contains("§")) {
/*  76 */         eos/moe/dragoncore/ija = null;
/*     */       }
/*     */     } 
/*     */     
/*  80 */     return eos/moe/dragoncore/ija;
/*     */   }
/*     */   
/*     */   public eos/moe/dragoncore/ija v(String str) {
/*  84 */     for (Map.Entry<String, eos/moe/dragoncore/ija> entry : this.d.entrySet()) {
/*  85 */       if (((eos/moe/dragoncore/ija)entry.getValue()).h() && str.contains(((eos/moe/dragoncore/ija)entry.getValue()).z())) {
/*  86 */         return (eos/moe/dragoncore/ija)entry.getValue();
/*     */       }
/*     */     } 
/*  89 */     return this.d.get(str);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public eos/moe/dragoncore/ija z(EntityLivingBase entityLivingBase) {
/*  99 */     String str1 = EntityList.func_75621_b((Entity)entityLivingBase);
/* 100 */     str1 = (str1 == null) ? "unknown" : str1.toLowerCase(Locale.ROOT);
/*     */     
/* 102 */     String str2 = z(entityLivingBase);
/* 103 */     if (this.t.containsKey(entityLivingBase.func_110124_au())) {
/* 104 */       str2 = this.t.get(entityLivingBase.func_110124_au());
/*     */     }
/* 106 */     for (Map.Entry<String, eos/moe/dragoncore/ija> entry : this.d.entrySet()) {
/* 107 */       eos/moe/dragoncore/ija eos/moe/dragoncore/ija1 = (eos/moe/dragoncore/ija)entry.getValue();
/*     */       
/* 109 */       if (eos/moe/dragoncore/ija1.h() && str2.contains(eos/moe/dragoncore/ija1.z()) && (eos/moe/dragoncore/ija.v(eos/moe/dragoncore/ija1).isEmpty() || eos/moe/dragoncore/ija.v(eos/moe/dragoncore/ija1).contains(str1))) {
/* 110 */         return (eos/moe/dragoncore/ija)entry.getValue();
/*     */       }
/*     */     } 
/* 113 */     eos/moe/dragoncore/ija eos/moe/dragoncore/ija = this.d.get(str2);
/* 114 */     if (eos/moe/dragoncore/ija != null && (eos/moe/dragoncore/ija.v(eos/moe/dragoncore/ija).isEmpty() || eos/moe/dragoncore/ija.v(eos/moe/dragoncore/ija).contains(str1))) {
/* 115 */       return eos/moe/dragoncore/ija;
/*     */     }
/* 117 */     return null;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public String z(EntityLivingBase entityLivingBase) {
/* 127 */     return pa.v(entityLivingBase.func_145748_c_().func_150260_c().replace(" ", ""));
/*     */   }
/*     */   
/*     */   public String v(EntityLivingBase entityLivingBase) {
/* 131 */     return entityLivingBase.func_145748_c_().func_150260_c().replace(" ", "");
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public eos/moe/dragoncore/tga h(eos/moe/dragoncore/ija eos/moe/dragoncore/ija1) {
/* 138 */     String str = eos/moe/dragoncore/ija1.z();
/*     */     
/* 140 */     if (this.z.containsKey(str)) {
/* 141 */       return this.z.get(str);
/*     */     }
/* 143 */     ResourceLocation resourceLocation1 = eos/moe/dragoncore/ija1.z();
/* 144 */     ResourceLocation resourceLocation2 = eos/moe/dragoncore/ija1.h();
/*     */ 
/*     */     
/* 147 */     if (resourceLocation1.func_110623_a().endsWith(".bbmodel"))
/*     */     {
/*     */       
/* 150 */       try (IResource a = Minecraft.func_71410_x().func_110442_L().func_110536_a(resourceLocation1)) {
/*     */         
/* 152 */         pt pt = tq.v(iResource.func_110527_b());
/* 153 */         rx.v(resourceLocation1.func_110623_a() + "/model.json", pt.z());
/* 154 */         rx.v(resourceLocation1.func_110623_a() + "/animation.json", pt.v());
/* 155 */         for (Map.Entry<String, byte> entry : pt.v().entrySet()) {
/* 156 */           rx.v(resourceLocation1.func_110623_a() + "/" + (String)entry.getKey(), (byte[])entry.getValue());
/*     */         }
/* 158 */         resourceLocation2 = new ResourceLocation(resourceLocation1.func_110624_b(), resourceLocation1.func_110623_a() + "/animation.json");
/* 159 */         resourceLocation1 = new ResourceLocation(resourceLocation1.func_110624_b(), resourceLocation1.func_110623_a() + "/model.json");
/*     */       }
/* 161 */       catch (Exception exception) {
/*     */         
/* 163 */         exception.printStackTrace();
/* 164 */         nm.m.c("无法加载模型: " + str + "  错误原因已输出至客户端log内");
/*     */         
/* 166 */         this.z.put(str, this.q);
/* 167 */         return this.q;
/*     */       } 
/*     */     }
/*     */ 
/*     */     
/* 172 */     ResourceLocation resourceLocation3 = resourceLocation1;
/* 173 */     ResourceLocation resourceLocation4 = resourceLocation2;
/* 174 */     this.g.submit(() -> {
/*     */           rm rm = th.v(resourceLocation1);
/*     */           
/*     */           if (rm.getBaseModel() == th.g.get(0)) {
/*     */             nm.m.c("无法加载模型: " + str + "  错误原因已输出至客户端log内");
/*     */           }
/*     */           
/*     */           for (vl vl : rm.getBaseModel().getPieceMap().values()) {
/*     */             for (ql ql : vl.t) {
/*     */               ql.v(eos/moe/dragoncore/ija1.z().func_110623_a());
/*     */             }
/*     */           } 
/*     */           Map<String, bo> map = null;
/*     */           if (eos/moe/dragoncore/ija1.h() != null) {
/*     */             try {
/*     */               map = bg.v(resourceLocation2);
/* 190 */             } catch (Exception exception) {
/*     */               nm.m.d("无法加载模型动画: " + str + "  错误原因已输出至客户端log内");
/*     */             } 
/*     */           }
/*     */           nz nz = null;
/*     */           try {
/*     */             nz = fq.v(eos/moe/dragoncore/ija1.y());
/* 197 */           } catch (Exception exception) {
/*     */             exception.printStackTrace();
/*     */             
/*     */             nm.m.d("无法加载模型动画控制器: " + str + "  错误原因已输出至客户端log内");
/*     */           } 
/*     */           
/*     */           eos/moe/dragoncore/tga eos/moe/dragoncore/tga1 = new eos/moe/dragoncore/tga(rm, map, nz);
/*     */           
/*     */           this.z.put(str, eos/moe/dragoncore/tga1);
/*     */         });
/* 207 */     this.z.put(str, this.q);
/* 208 */     return this.q;
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public eos/moe/dragoncore/tga z(eos/moe/dragoncore/ija eos/moe/dragoncore/ija1) {
/* 214 */     String str = eos/moe/dragoncore/ija1.z();
/*     */     
/* 216 */     if (this.i.containsKey(str)) {
/* 217 */       return this.i.get(str);
/*     */     }
/*     */ 
/*     */     
/* 221 */     this.g.submit(() -> {
/*     */           eos/moe/dragoncore/tga eos/moe/dragoncore/tga1;
/*     */           
/*     */           Map<String, bo> map = null;
/*     */           
/*     */           if (eos/moe/dragoncore/ija1.h() != null) {
/*     */             try {
/*     */               map = bg.v(eos/moe/dragoncore/ija1.h());
/* 229 */             } catch (Exception exception) {
/*     */               nm.m.d("无法加载模型动画: " + str + "  错误原因已输出至客户端log内");
/*     */             } 
/*     */           }
/*     */           try {
/*     */             ModelBase modelBase = se.v(eos/moe/dragoncore/ija1.z());
/*     */             eos/moe/dragoncore/tga1 = new eos/moe/dragoncore/tga(modelBase, map);
/* 236 */           } catch (Exception exception) {
/*     */             eos/moe/dragoncore/tga1 = new eos/moe/dragoncore/tga(th.v(), map);
/*     */             
/*     */             nm.m.c("无法加载OBJ模型: " + str + "  错误原因已输出至log内");
/*     */             
/*     */             exception.printStackTrace();
/*     */           } 
/*     */           
/*     */           this.i.put(str, eos/moe/dragoncore/tga1);
/*     */         });
/* 246 */     this.i.put(str, this.q);
/* 247 */     return this.q;
/*     */   }
/*     */ 
/*     */   
/*     */   public eos/moe/dragoncore/tga v(eos/moe/dragoncore/ija eos/moe/dragoncore/ija1) {
/* 252 */     String str = eos/moe/dragoncore/ija1.z();
/*     */     
/* 254 */     if (this.w.containsKey(str)) {
/* 255 */       return this.w.get(str);
/*     */     }
/*     */ 
/*     */     
/* 259 */     this.g.submit(() -> {
/*     */           eos/moe/dragoncore/tga eos/moe/dragoncore/tga1;
/*     */           
/*     */           try {
/*     */             ModelBase modelBase = (iy)zy.g.loadModel(eos/moe/dragoncore/ija1.z());
/*     */             
/*     */             eos/moe/dragoncore/tga1 = new eos/moe/dragoncore/tga(modelBase, new HashMap<>());
/* 266 */           } catch (Exception exception) {
/*     */             eos/moe/dragoncore/tga1 = new eos/moe/dragoncore/tga(th.v(), new HashMap<>());
/*     */             
/*     */             nm.m.c("无法加载Smd模型: " + str + "  错误原因已输出至log内");
/*     */             
/*     */             exception.printStackTrace();
/*     */           } 
/*     */           
/*     */           this.w.put(str, eos/moe/dragoncore/tga1);
/*     */         });
/* 276 */     this.w.put(str, this.q);
/* 277 */     return this.q;
/*     */   }
/*     */ 
/*     */   
/*     */   public ConcurrentHashMap<String, eos/moe/dragoncore/ija> h() {
/* 282 */     return this.d;
/*     */   }
/*     */   
/*     */   public ConcurrentHashMap<String, eos/moe/dragoncore/tga> z() {
/* 286 */     return this.z;
/*     */   }
/*     */ 
/*     */   
/*     */   public static class eos/moe/dragoncore/tga
/*     */   {
/*     */     private ModelBase w;
/*     */     
/*     */     private Map<String, bo> q;
/*     */     private nz g;
/*     */     
/*     */     public eos/moe/dragoncore/tga(ModelBase modelBase, Map<String, bo> map) {
/* 298 */       this(modelBase, map, null);
/*     */     }
/*     */     
/*     */     public eos/moe/dragoncore/tga(ModelBase modelBase, Map<String, bo> map, nz nz1) {
/* 302 */       this.w = modelBase;
/*     */       
/* 304 */       this.q = map;
/* 305 */       this.g = nz1;
/*     */     }
/*     */     
/*     */     public ModelBase v() {
/* 309 */       return this.w;
/*     */     }
/*     */ 
/*     */     
/*     */     public Map<String, bo> v() {
/* 314 */       return this.q;
/*     */     }
/*     */     
/*     */     public nz v() {
/* 318 */       return this.g;
/*     */     } }
/*     */   
/*     */   public static class eos/moe/dragoncore/ija {
/*     */     private String v;
/*     */     private boolean k;
/*     */     private float o;
/*     */     private float y;
/*     */     private float h;
/*     */     private String u;
/*     */     private boolean j;
/*     */     private boolean c;
/*     */     private boolean r;
/*     */     private boolean f;
/*     */     private boolean s;
/*     */     private ResourceLocation m;
/*     */     private ResourceLocation l;
/*     */     private ResourceLocation t;
/*     */     private ResourceLocation d;
/*     */     private ResourceLocation z;
/*     */     private vu i;
/*     */     private Set<String> w;
/*     */     private boolean q;
/*     */     private boolean g;
/*     */     
/*     */     public boolean k() {
/* 344 */       return this.q;
/*     */     }
/*     */ 
/*     */ 
/*     */     
/*     */     public boolean d() {
/* 350 */       return this.g;
/*     */     }
/*     */     
/*     */     public boolean c() {
/* 354 */       return this.s;
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*     */     public eos/moe/dragoncore/ija(ConfigurationSection configurationSection) {
/* 362 */       if (configurationSection.isConfigurationSection("transform")) {
/* 363 */         this.i = new vu(configurationSection.getConfigurationSection("transform"));
/*     */       }
/*     */       
/* 366 */       this.v = configurationSection.getString("entity", "unknown");
/* 367 */       this.v = this.v.replace("&", "§").replace(" ", "");
/* 368 */       this.v = pa.v(this.v);
/* 369 */       this.r = configurationSection.getBoolean("contains");
/* 370 */       this.f = configurationSection.getBoolean("requireColor");
/*     */       
/* 372 */       this.k = configurationSection.getBoolean("hidename");
/*     */       
/* 374 */       this.o = (float)configurationSection.getDouble("scale", 1.0D);
/*     */       
/* 376 */       this.y = Math.max((float)configurationSection.getDouble("height", 1.0D), 1.0E-5F);
/* 377 */       this.h = Math.max((float)configurationSection.getDouble("width", 1.0D), 1.0E-5F);
/*     */       
/* 379 */       this.u = configurationSection.getString("blood");
/* 380 */       this.q = configurationSection.getBoolean("renderAlways");
/* 381 */       this.g = configurationSection.getBoolean("hurtColor", true);
/* 382 */       this.s = configurationSection.getBoolean("shadow", true);
/*     */       
/* 384 */       List<? extends String> list = configurationSection.getStringList("type");
/* 385 */       list.replaceAll(a -> a.toLowerCase(Locale.ROOT));
/* 386 */       this.w = new HashSet<>(list);
/*     */ 
/*     */       
/* 389 */       String str1 = configurationSection.getString("texture", "unknown");
/* 390 */       String str2 = configurationSection.getString("glowTexture");
/* 391 */       String str3 = configurationSection.getString("model", "unknown");
/* 392 */       String str4 = configurationSection.getString("controller");
/* 393 */       String str5 = configurationSection.getString("animation");
/* 394 */       this.j = str3.endsWith(".obj");
/* 395 */       this.c = str3.endsWith(".pqc");
/*     */       
/* 397 */       if (str3.endsWith(".bbmodel")) {
/* 398 */         str1 = str3 + "/" + str1;
/* 399 */         if (str2 != null) {
/* 400 */           str2 = str3 + "/" + str2;
/*     */         }
/*     */       } 
/*     */       
/* 404 */       this.t = v(str1);
/* 405 */       if (str2 != null) {
/* 406 */         this.z = v(str2);
/*     */       }
/* 408 */       this.l = v(str3);
/* 409 */       if (str5 != null) {
/* 410 */         this.m = v(str5);
/*     */       }
/* 412 */       if (str4 != null) {
/* 413 */         this.d = v(str4);
/*     */       } else {
/* 415 */         this.d = new ResourceLocation("dragoncore", "models/entity/controller.yml");
/*     */       } 
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*     */     public void v() {
/* 431 */       if (this.i != null) {
/* 432 */         this.i.v();
/*     */       }
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*     */     public xea.eos/moe/dragoncore/tga v() {
/* 442 */       if (this.c)
/* 443 */         return xea.m.v(this); 
/* 444 */       if (this.j) {
/* 445 */         return xea.m.z(this);
/*     */       }
/* 447 */       return xea.m.h(this);
/*     */     }
/*     */ 
/*     */     
/*     */     public String z() {
/* 452 */       return this.v;
/*     */     }
/*     */ 
/*     */     
/*     */     public boolean s() {
/* 457 */       return this.k;
/*     */     }
/*     */     
/*     */     public float h() {
/* 461 */       return this.o;
/*     */     }
/*     */     
/*     */     public float z() {
/* 465 */       return this.y;
/*     */     }
/*     */     
/*     */     public float v() {
/* 469 */       return this.h;
/*     */     }
/*     */     
/*     */     public String v() {
/* 473 */       return this.u;
/*     */     }
/*     */     
/*     */     public boolean y() {
/* 477 */       return this.j;
/*     */     }
/*     */     
/*     */     public ResourceLocation y() {
/* 481 */       return this.d;
/*     */     }
/*     */     
/*     */     public ResourceLocation t() {
/* 485 */       return this.t;
/*     */     }
/*     */     
/*     */     public ResourceLocation h() {
/* 489 */       return this.m;
/*     */     }
/*     */     
/*     */     public ResourceLocation z() {
/* 493 */       return this.l;
/*     */     }
/*     */     
/*     */     public boolean t() {
/* 497 */       return this.l.func_110623_a().equals("models/entities/empty");
/*     */     }
/*     */     
/*     */     public boolean h() {
/* 501 */       return this.r;
/*     */     }
/*     */     
/*     */     public boolean z() {
/* 505 */       return this.f;
/*     */     }
/*     */     
/*     */     public ResourceLocation v() {
/* 509 */       return this.z;
/*     */     }
/*     */     
/*     */     public boolean v() {
/* 513 */       return this.c;
/*     */     }
/*     */   }
/*     */   
/*     */   public enum eos/moe/dragoncore/qca {
/* 518 */     i,
/* 519 */     w,
/* 520 */     q;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\xea.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */